using Assets.Scripts.GDK;
using System;
using UnityEngine;
using UnityEngine.UI;

namespace Brick
{
	public class ShopNoAdItem : gdk_base_layer
	{
		public RectTransform btn;

		public Text MoneyText;

		private GameShopModel myGiftInfo;

		public void OnData(GameShopModel gameShopModel, Action callback)
		{
			myGiftInfo = gameShopModel;
			OnUIUpdate();
			btn.GetComponent<Button>().onClick.AddListener(delegate
			{
				gdk_game_manager.PlaySound(AudioID.click);
				callback();
			});
		}

		public void OnUIUpdate()
		{
			if (GDK.ModuleManger.Module<ShopPanelModule>().GetBuyNoAd())
			{
				MoneyText.text = "Purchased";
				btn.GetComponent<Button>().interactable = false;
			}
			else
			{
				btn.GetComponent<Button>().interactable = true;
				MoneyText.text = "$" + myGiftInfo.dollar;
			}
		}
	}
}

